package com.gwtplatform.samples.tab.client.news;

import com.google.inject.Inject;

import com.guit.client.GuitPresenter;
import com.guit.client.binder.GuitBinder;
import com.guit.client.place.Place;
import com.guit.client.place.PlaceName;
import com.gwtplatform.samples.tab.client.main.MainPresenter;
import com.gwtplatform.samples.tab.client.main.MainPresenter.Home;
import com.gwtplatform.samples.tab.client.news.HomeNewsPresenter.HomeNewsBinder;

@PlaceName("news")
public class HomeNewsPresenter extends GuitPresenter<HomeNewsBinder> implements Place<Void> {

    public static interface HomeNewsBinder extends GuitBinder<HomeNewsPresenter> {
    }
    
    private final MainPresenter mainPresenter;
    
    @Inject
    public HomeNewsPresenter(MainPresenter mainPresenter) {
        this.mainPresenter = mainPresenter;
    }

    @Override
    public void go(Void data) {
        mainPresenter.setHome(Home.NEWS, getView());
    }
}
